<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/metinfo.css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.0.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/cookie.js"></script>

<script type="text/javascript">
var bnt_txt1 = "获取Meta信息";
var bnt_txt2 = "网站已经存在";
$(function() {
	$('table tr').each(function(i, obj) {
		$(obj).find('td').eq(0).addClass("text");
		$(obj).find('td').eq(1).addClass("input");
		$(obj).find('td').eq(1).children('input').addClass('text');
		$(obj).find('td').eq(1).children('textarea').addClass('textarea gen');
	});
	$('table tr:last').find('input').attr('class','submit');
	$('#getmeta').bind('click', function() {
		var weburl = $('#weburl').val();
		$.post('{:U("Site/ajaxCheck")}', {
			action : "metainfo",
			weburl : weburl
		}, function(data) {
			if (data.status == 1) {
				$('#weburl').addClass('pass');
				$('#pages').val(data.data.pages);
				$('#unlinks').val(data.data.unlinks);
				$('#snapshot').val(data.data.snapshot);
				$('#webmetatitle').val(data.data.title);
				$('#webmetakeys').val(data.data.keywords);
				$('#webmetadesc').val(data.data.description);
			} else {
				$('#weburl').addClass('error');
				alert(data.info);
			}
		})
	})
})

function checkUrl(obj) {
	var weburl = obj.value;
	if (weburl.length > 0) {
		$.post('{:U("Site/ajaxCheck")}', {
			action : "checkurl",
			weburl : weburl
		}, function(data) {
			if (data) {
				$(obj).addClass('pass');
			} else {
				$('#getmeta').unbind('click');
				$(obj).addClass('error');
				$(obj).focus();
			}
		})
	} else {
		$(obj).addClass('error');
		$(obj).focus();
	}
}
</script>
<style type="text/css">
.error {
	border-color: red !important;
	background-color: #FFDDDD !important;
	color: red !important;
}

.pass {
	border-color: green !important;
	background-color: #DEFEE4 !important;
	color: green !important;
}

.abnt {
	border: 1px solid black;
	padding: 3px;
	font-size: 12px;
}
*{
	font-family:consolas;
	font-size:12px;
}
</style>
</head>
<body>
	<div class="metinfotop">
		<div class="position">简体中文：网站后台 > <a href="{:U('Index/lists')}">网站管理</a> > 添加网站</div>
		<div class="return"><a href="">&lt;&lt;返回</a></div>
	</div>
	<div class="clear"></div>
	<form action="{$url}" method="post">
		<table cellpadding="2" cellspacing="1" class="table">
			<tr>
				<td class="text">网站地址：</td>
				<td class="input">
				<input type="text" id="weburl" name="webinfo[weburl]" value="http://" class="text"/>&nbsp;&nbsp;<a
					class="submit li-submit" id="getmeta">获取Meta信息</a></td>
			</tr>
			<tr>
				<td>网站名称：</td>
				<td><input style="width: 300px;" type="text" id="webname"
					name="webinfo[webname]" /></td>
			</tr>
			<tr>
				<td>网站标题：</td>
				<td><textarea id="webmetatitle" cols="40"
					name="webinfo[webmetatitle]" ></textarea></td>
			</tr>
			<tr>
				<td>网站关键字：</td>
				<td><textarea name="webinfo[webmetakeys]" cols="40"
						id="webmetakeys"></textarea></td>
			</tr>
			<tr>
				<td>网站描述：</td>
				<td><textarea name="webinfo[webmetadesc]" cols="40"
						id="webmetadesc"></textarea></td>
			</tr>
			<tr>
				<td>搜索引擎类型：</td>
				<td><select name="cominfo[seid]"><option value="1">百度</option></select></td>
			</tr>
			<tr>
				<td>网站收录：</td>
				<td><input type="text" id="pages" name="cominfo[pages]" /></td>
			</tr>
			<tr>
				<td>网站反链：</td>
				<td><input type="text" id="unlinks" name="cominfo[unlinks]" /></td>
			</tr>
			<tr>
				<td>网站快照：</td>
				<td><input type="text" id="snapshot" name="cominfo[snapshot]" /></td>
			</tr>
			<tr>
				<td><input type="reset" value="重置"></td>
				<td><input type="submit" name="submit" value="添加" class="submit li-submit"></td>
			</tr>
		</table>
	</form>
</body>
</html>